package spring.code;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author DRevelation
 * @Date 2020-06-30 上午 9:23
 * @Desc 事件监听者
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {

    @Override
    public void onApplicationEvent(DemoEvent event) {
        String msg = event.getMessage();
        System.out.println("接收到的消息是: " + msg);
    }
}
